/*
 * Copyright (C) 2010-2011 Graz University of Technology, Austria. All Rights reserved. 
 *
 * Contact: Simone Kopeinik <simone.kopeinik@tugraz.at>
 * 	   Graz University of Technology, Knowledge Management Institute, Brückenkopfgasse 1/6, 8020 Graz 	
 * 	   <http://www.kmi.tugraz.at/>
 * 
 * This software is part of the TARGET platform developed by the
 * TARGET EC-funded project www.reachyourtarget.org
 *
 * This software is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, version 3.
 *
 * This software is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 *
 * The GNU General Public License is available at <http://www.gnu.org/licenses/>.
 *
 */
package at.tugraz.kmi.css.cbkst2;

import com.google.common.collect.ImmutableCollection;

/**
 * <p>
 * The Transfer Function assigns to each <code>S</code> a non-empty collection
 * of non-empty subsets of <code>T</code>. An implementation of a Transfer
 * Function is e.g. the {@link CompetenceFunction}. Assigning more than one
 * Skills to a CbKSTPerformance takes care of the fact that there may be more
 * than one CbKSTCompetence necessary to solve a CbKSTPerformance.
 * </p>
 * 
 * @author Georg Öttl <georg.oettl@gmail.com>
 * 
 * @param <S>
 *            The source
 * @param <T>
 *            The target
 * 
 * @see PerformanceFunction
 * @see CompetenceFunction
 */
public interface TransferFunction<S, T> {

	/**
	 * Adds a problem to CbKSTCompetence mapping.
	 * 
	 * @param source
	 * @param target
	 */
	void addMapping(S source, T... target);

	/**
	 * @param key
	 * @return a Collection of target <code>T</code> objects.
	 */
	ImmutableCollection<T> get(S key);

	/**
	 * 
	 * The {@code PerformanceFunction} function creates the inverse of this
	 * function. The inverse of the {@code PerformanceFunction} is the
	 * {@code CompetenceFunction}.
	 * 
	 * @return A copy of this {@code PerformanceFunction} as
	 *         {@code CompetenceFunction}.
	 */
	TransferFunction<T, S> invert();

}